package org.example.test1;

class NewThread implements Runnable {
    private Bank bank;

    public NewThread(Bank bank) {
        this.bank = bank;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {

            bank.save(10); //或使用 bank.save1(10);
            System.out.println(i + "账户余额为：" + bank.getAccount());
        }
    }
}
